<?php
class PresentationImage extends Presentation {
    public function formatFormField(&$field) {
        if (isset($field['value']) && $field['value']) {
            $field['type'] = 'html';
            $field['html'] = '<img src="' .
                    Kernel::getSimpleImageLink($field['value'], 80, 80, true) .
                    '" alt="" /><br /><input type="file" name="' .
                    $field['name'] . '" />';
        } else {
            $field['type'] = 'file';
        }
    }
    
    public function formatForList($value) {
        return $value ? '<img src="' . Kernel::getSimpleImageLink($value,
                50, 50, true) . '" alt="" />' : '--';
    }
    
    public function getFilteringType() {
        return 'hidden';
    }
}